
The following are general purpose MATLAB functions based on algorithms discussed in the text. An explanation of how to use the command, along with examples, are provided in each file. These files are also available from Mathworks' File Exchange.


What's Included:

solve.m:  This finds a solution of f(x)=0. It is capable of solving equations where MATLAB's fzero command fails, it does not require (or use) MATLAB's vectorization notation, and it is comparable with fzero in terms of speed and accuracy.

tridiag.m:  This is an implementation of the Thomas algorithm (for solving a nxn tridiagonal matrix equation).

splineA.m:  Cubic spline interpolation. It works for nonuniformly spaced nodes, and it can also handle any combination of first or second derivative end conditions (so, it includes both natural and clamped cubic splines).

splineB.m:  Cubic spline interpolation. The difference from splineA.m is that this program finds the coefficients of the cubics making up the spline.

int.m:  This computes the integral of f(x) from x=a to x=b using an adaptive Simpson's rule. MATLAB vectorization is not used when defining the function. Even so, in terms of speed and accuracy, it is comparable to MATLAB's integrate command.

cgm.m:  This solves Ax=b using the conjugate gradient method.

cgmS.m:  This solves Ax=b using the conjugate gradient method, when A is a large sparse matrix that is stored in a row-compressed format. This format is explained in Section 9.3.4.



